<template>
  <router-view v-slot="{ Component }">
    <transition name="fade-slide" mode="out-in">
      <component :is="Component" />
    </transition>
  </router-view>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
/* 全局变量 */
:root {
  --bg-color: #f5f7fa;
  --border-color: #e4e7ed;
  --text-color: #303133;
  --el-color-primary: #409eff;
}

/* 暗黑模式变量 */
.dark-theme {
  --bg-color: #1a1d2d;
  --border-color: #2d3348;
  --text-color: #e9eaf0;
  --el-color-primary: #5b8af5;
  
  /* 覆盖Element Plus的暗色变量 */
  --el-color-white: #1a1d2d;
  --el-bg-color: #1a1d2d;
  --el-bg-color-overlay: #242736;
  --el-text-color-primary: #e9eaf0;
  --el-text-color-regular: #cfd0d9;
  --el-text-color-secondary: #a0a3b1;
  --el-border-color: #2d3348;
  --el-border-color-light: #363c52;
  --el-border-color-lighter: #252a3d;
  --el-fill-color: #242736;
  --el-fill-color-light: #2a2f42;
  --el-fill-color-blank: #1a1d2d;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

#app {
  height: 100%;
}

/* 全局过渡动画 */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-slide-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(-20px);
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: #c0c4cc;
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background-color: #f5f7fa;
}

.dark-theme ::-webkit-scrollbar-thumb {
  background-color: #3d4256;
}

.dark-theme ::-webkit-scrollbar-track {
  background-color: #242736;
}

/* 卡片全局样式 */
.el-card {
  border: none !important;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.dark-theme .el-card {
  background-color: #242736 !important;
  color: var(--text-color);
}

/* 输入框全局样式 */
.el-input__wrapper {
  box-shadow: 0 0 0 1px #dcdfe6 inset;
}

.el-input__wrapper:hover {
  box-shadow: 0 0 0 1px var(--el-color-primary) inset;
}

.dark-theme .el-input__wrapper {
  box-shadow: 0 0 0 1px #3d4256 inset !important;
  background-color: #242736 !important;
}

.dark-theme .el-input__inner {
  color: #e9eaf0 !important;
}

/* 选择框样式 */
.dark-theme .el-select-dropdown {
  background-color: #242736 !important;
  border-color: #363c52 !important;
}

.dark-theme .el-select-dropdown__item {
  color: #e9eaf0 !important;
}

.dark-theme .el-select-dropdown__item.hover, 
.dark-theme .el-select-dropdown__item:hover {
  background-color: #2a2f42 !important;
}

.dark-theme .el-select-dropdown__item.selected {
  color: var(--el-color-primary) !important;
  font-weight: bold;
}

/* 按钮全局样式 */
.el-button {
  font-weight: 500;
}

.dark-theme .el-button {
  background-color: #2d3348;
  border-color: #363c52;
  color: #e9eaf0;
}

.dark-theme .el-button--primary {
  background-color: var(--el-color-primary);
  border-color: var(--el-color-primary);
  color: white;
}

.dark-theme .el-button--success {
  background-color: #67c23a;
  border-color: #67c23a;
  color: white;
}

.dark-theme .el-button--warning {
  background-color: #e6a23c;
  border-color: #e6a23c;
  color: white;
}

.dark-theme .el-button--danger {
  background-color: #f56c6c;
  border-color: #f56c6c;
  color: white;
}

/* 表格全局样式 */
.el-table {
  --el-table-header-bg-color: #f5f7fa;
  --el-table-row-hover-bg-color: #f5f7fa;
  border-radius: 8px;
  overflow: hidden;
}

.dark-theme .el-table {
  --el-table-header-bg-color: #242736;
  --el-table-row-hover-bg-color: #2a2f42;
  --el-table-border-color: #363c52;
  --el-table-header-text-color: #ffffff;
  --el-table-text-color: #ffffff;
  --el-table-bg-color: #1e2235;
  background-color: #1e2235;
}

.dark-theme .el-table th {
  background-color: #242736 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.dark-theme .el-table td, 
.dark-theme .el-table th.is-leaf {
  border-bottom: 1px solid #363c52 !important;
}

.dark-theme .el-table--border::after, 
.dark-theme .el-table--group::after {
  background-color: #363c52;
}

.dark-theme .el-table tr {
  background-color: #1e2235 !important;
}

.dark-theme .el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: #242736 !important;
}

.dark-theme .el-table__body tr:hover > td {
  background-color: #2a2f42 !important;
}

/* 下拉菜单样式 */
.dark-theme .el-dropdown-menu {
  background-color: #242736;
  border: 1px solid #363c52;
}

.dark-theme .el-dropdown-menu__item {
  color: #e9eaf0;
}

.dark-theme .el-dropdown-menu__item:hover {
  background-color: #2a2f42;
}

/* 标签样式 */
.dark-theme .el-tag {
  background-color: #242736;
  border-color: #363c52;
  color: #ffffff;
}

.dark-theme .el-tag--success {
  background-color: rgba(103, 194, 58, 0.2);
  border-color: rgba(103, 194, 58, 0.5);
  color: #95d475;
}

.dark-theme .el-tag--warning {
  background-color: rgba(230, 162, 60, 0.2);
  border-color: rgba(230, 162, 60, 0.5);
  color: #f0c78a;
}

.dark-theme .el-tag--danger {
  background-color: rgba(245, 108, 108, 0.2);
  border-color: rgba(245, 108, 108, 0.5);
  color: #f89898;
}

.dark-theme .el-tag--info {
  background-color: rgba(144, 147, 153, 0.2);
  border-color: rgba(144, 147, 153, 0.5);
  color: #bbbec4;
}

/* 分页样式 */
.dark-theme .el-pagination {
  color: #e9eaf0;
}

.dark-theme .el-pagination button, 
.dark-theme .el-pager li {
  background-color: #242736 !important;
  color: #e9eaf0 !important;
}

.dark-theme .el-pagination .el-pagination__total,
.dark-theme .el-pagination .el-pagination__sizes,
.dark-theme .el-pagination .el-pagination__jump {
  color: #e9eaf0;
}

.dark-theme .el-pagination .btn-prev,
.dark-theme .el-pagination .btn-next {
  background-color: #242736 !important;
  color: #e9eaf0 !important;
}

.dark-theme .el-pager li.is-active {
  background-color: var(--el-color-primary) !important;
  color: #ffffff !important;
}

.dark-theme .el-select .el-input .el-select__caret {
  color: #e9eaf0;
}
</style> 